package com.example.newfeature.fragment

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.newfeature.R

/**
 *
 *
 * @author: tuyrt7 on 2020/12/2.
 */
class HostActivity : AppCompatActivity() {

    private val customFragmentFactory = CustomFragmentFactory(Dependency())

    override fun onCreate(savedInstanceState: Bundle?) {
        supportFragmentManager.fragmentFactory = customFragmentFactory
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_host)
        if (savedInstanceState == null) {
            val argments = Bundle().apply {
                putString("arg", "111")
            }
            supportFragmentManager.beginTransaction()
                .add(R.id.content, CustomFragment::class.java, argments)
                .commit()
        }

    }
}

